Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

234
Visualizações
ln-service (npm-package) [ 400, 'ExpectedLndToCreateNewInvoice' ]

I'm using ln-service package and I'm connected to a local instance of lnd node (created with polar). I'm using plain js.

import lnservice from 'ln-service';


let lndz = lnservice.authenticatedLndGrpc({
    cert: tls,
    macaroon: adminMacaroon,
    socket: socket
})

try {
    let res = await lnservice.createInvoice({mtokens: "500", description: "new invoice", lnd:lndz})
} catch (error) {
    console.log("ERROR",error);
}   

Error:

[ 400, 'ExpectedLndToCreateNewInvoice' ]

The only hint I'm getting from IDE is that lndz should have these fields, but I don't know what I should put in these fields, since it's not mentioned in the docs.

  autopilot: any;
  chain: any;
  default: any;
  invoices: any;
  router: any;
  signer: any;
  tower_client: any;
  tower_server: any;
  wallet: any;
  version: any;

What does 400 mean? How can I debug this? I looked at LND logs but no help there. How would I know what to put in those fields, since only 3 of the fields were mentioned

If I run a different method:

lnservice.getHeight(lndz)

I'm getting the correct block height, so it seems that I'm able to make a connection to the LND node.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Have to use object destructuring.

let {lnd} = lnservice.authenticatedLndGrpc({
    cert: tls,
    macaroon: adminMacaroon,
    socket: socket
})
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda